Okay.
So today we're going to be having a look at tools.
So we're going to have a look at how to create tools what they are and some of the properties and settings
of the tools you might want to be changing.
Okay.
So first off what are tools.
So tools are items that you can pick up and sometimes use in your game.
This can be things like food.
Sometimes you can pick up and you can catch.
They can eat the food and stuff like that.
Roblox has a default, um, tool.
Called a a sword.
Let's just search that up.
I'll be good at explanation of what these tools are.
So this here is a tool.
You've probably seen it before.
And if we just quickly play the game to have a look.
We can see here that I have an item in here.
And if I click one, oh, it's been anchored.
But, um, let's you get the point.
Now it adds it in, it puts it into your hand so you can use it.
Obviously this is not meant to happen.
I believe it's because it's anchored.
You can have a look.
It's just anchored.
There we go.
Let's try that again.
But yeah, you've most likely seen it before in a lot of games.
But yeah, and you can hold it.
And this one has animations and stuff, but we won't be learning about that just yet.
That would be scripting.
But um, yeah.
So that is what tools are.
And we're going to have a look today at how to make them.
Okay.
So um, tools are a bit more tricky to make when anything else because everything needs to be connected.
But we'll have a look at that, um, a bit later on.
Um, so let's go into starter pack because this is where all our tools are going to go.
Okay.
Any tools that you want the player to have as soon as they start the game are going to go into starter
pack, click the plus and add another tool object.
Okay.
And this is a bunch of properties, most of which we're not going to cover.
But there's a couple that are quite important.
Requires handle must be on okay.
As that's the the method we're going to use to make this tool work okay.
You also have can be dropped.
So can you.
Are you able to drop a tool and some grip and origin positions.
The grip ones we're going to have a look at in a minute.
Um but the origin ones we're not going to cover okay.
So first we need a or something to hold um as the tool.
Okay.
I'm going to go into the toolbox for this and find something that I could maybe use as a tool.
Let's go for the lights.
Maybe, um, let's go for the flashlight.
I think this is a tool already, but I'm just going to take the, um.
Okay.
And no, I want it a different way.
Um.
Let's see what we could use.
Lantern.
It needs to be made a certain way.
There we go.
Perfect.
Let's use this lantern.
Let's get rid of the, um.
Where is it?
Okay, so let me just set this up for a minute.
Um, um, expand all.
I'm just going to get rid of some stuff here.
Um, so these all have worlds and stuff like that inside of them.
Um, we're going to weld them ourselves, so we don't need those.
Um, I'm just getting rid of all of those.
Okay.
And it's got lights and stuff in it as well, which you've already looked at.
Um, particle emitter, I believe it's probably for the bulb inside there.
That's fine.
Okay.
Cool.
And let's just take all this out of the tool and then just work on it ourselves.
Okay, cool.
So we've got our model.
Obviously we recommend making it yourself.
Okay.
Um, but because of this, this light here has a lot of curves and things like that.
You can't really make that in Roblox studio too easily.
Um.
So a lot of it has been meshes and things like that imported from other places.
But yeah.
So first I'm going to put all of this inside of a model.
Okay.
So it's all grouped together nicely.
And this is going to be called Lantern.
So let's select it all using let's use the box select.
And put all that into the lantern.
Cool.
Now you notice that there's one part called handle which is seemingly just here, which is a bit weird.
Um, I'm going to put that outside of the model now.
Handle is one we're going to talk about just in a minute, but it's a very important part.
Okay.
Let's put all this and the handle into the tool.
And it now disappears because it's inside starter pack, not in the workspace.
Remember, only the stuff you can see is in the workspace.
Um, okay, so, um, what's what's the handle for?
So the handle is a very important part, and it tells the, um, well, it's where the player puts their
hand, so.
When the player equips the tool, where is the tool connected to the player's hand basically, and that's
where the handle is for.
So because the player can technically hold hold the tool anywhere, so it just makes it very clear where
the player needs to hold it.
Okay, so when you are making tools yourself, you need to have an unanchored part called handle inside
there, or this must be on an anchored.
The reason why it has to be unanchored is I'll show you in a minute why?
But let's play the game and see what happens when we equip this tool.
So let's press one to equip it.
And.
Nothing happens.
So you did see what you did see a quick flash of lights there.
But, um, let's put it back into the workspace and let's move it up a bit.
Maybe.
So first issue is, is, is that this is anchored okay.
This everything here has to be on anchored.
The reason is because the player needs to be able to move this around with them.
Okay.
If you ever if you ever equip a tool and you kind of you go for tool instead of a tool going to you,
it's because you've anchored it.
So make sure it's on anchored.
And the second issue we have is that, um, what will happen is if I, um, play the game just like
this here, you should hopefully see what's going to happen.
For two just disappears for some reason.
Um.
The juvies have can collide, can collide on.
Okay, there we go.
And let's just run the game.
Okay, so it all breaks up like that's fair.
The reason?
Because it's not anchored, but we can't anchor it, otherwise it won't work properly.
So what we want to do is we need to make all of these parts.
Um, well, we need to make them, um, they need to be on anchored, but they all need to stick together.
And we can do that by using things called weld constraints.
Now, constraints is a topic we will have a look at later on properly in the course.
But we're just going to quickly touch on them now.
Um, just so you know what they are.
And so you can make your own tools.
So we've got all our objects here.
Okay.
You want to pick one primary object?
Okay.
Um, or the handle would need to be included in this as well.
So let's put the handle.
The bear as well.
Cool.
Okay, so what you want to do is let's open up all of these, um, here so we can see.
Okay, so first one is this object here inside of it, we want to, um, keep together.
So basically, um, how to, how do our constraint works is that, um, you weld one part to another
part, and basically the distance between those two parts will always stay the same.
And that's how you're able to keep it together while also being unanchored.
So going to the first one which I've got here is the union.
Let's add in a weld constraint.
And we have two parts here that we're going to give it.
So part zero is going to be its parent.
And part one is going to be the handle okay.
And just duplicate that and continue it um for all of the other ones.
So for the bulb part zero is there.
For the flame.
It is there.
Yeah.
Sometimes when you're trying to move stuff just by dragging it, it doesn't particularly work.
Um, which is fine.
All you need to do is just use the parent property instead, which is what I'm doing now.
It's not as quick, but, um, sometimes it's the better method to use, um.
This part here.
This can take a while.
You can make scripts which automatically do this for you, so wouldn't be something you have to put
up with forever.
But until we've looked at scripting, this is unfortunately the way you have to do it.
Um.
Well constraint.
Okay.
Keep going down.
So just make sure you've been doing you do this for whatever, whatever, um, parts and stuff that
you have done.
Um.
Almost done now.
Oh, this has been set to part.
Set that to the handle.
That's set to the wrong one I did.
Let's set that to the handle and set that to the part okay.
We'll see if this has worked properly.
It might have one I've missed done.
But, um should all be okay.
Okay, cool.
We're done now.
So let's then put this handle inside of the tool.
And now let's see how it works.
We need to play the game, not run the game.
Um.
So now if we click one, it's into our hands.
Fine.
Okay.
So I can see one.
The lid here didn't do properly because it's all the way up there.
But as you can see, most of the stuff has worked fine.
So even though we're moving it around, um, it's still working fine.
So it's unanchored because we can move it around, but it's not just falling to the ground straight
away.
Okay, let's just fix the lid.
The lid bit as well.
Um.
And see what's wrong with that.
What bit is the lid?
This bit here.
Okay, that's probably a fix then.
So yeah that is how you create your tools.
Okay.
So step one is to add a tool object into the starter pack.
Step two is to get your model make sure it's on anchored.
So everything must be unanchored.
I'd also recommend to turn um can collide off um, because otherwise it can collide with the player
and make them move.
Or it can, it can just mess up a couple things so make sure Can Collide is off.
Then use your weld constraints by setting part zero to be the parent and part one to be the handle.
Okay?
Handle must be unanchored and it must be inside of a tool in order for it to work properly.
Okay.
And um, tools, we will have a look at a lot more detail, um, in our scripting sections because we
can actually code them to do stuff, which is really cool.
Um, but obviously we're just going to touch on it like that for now.
Okay.
So tools are really cool thing to use.
So try those out.
And next lesson we're going to have a look at another part which would be about um teams and how to
use those, which is actually just here.
So another part of the explorer we haven't just touched on just yet.
So have a go through those and try those out, make some yourself and then join me in the next lesson.